﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using weikebuluo.DAL;
using weikebuluo.Common;
using weikebuluo.Model;

namespace weikebuluo.web.wechat.market
{
    public partial class product_list : System.Web.UI.Page
    {
        a_product_dal productdal = new a_product_dal();
        protected DataTable dtproduct = new DataTable();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["uid"]) && !string.IsNullOrEmpty(Request.QueryString["search"]))
            {
                dtproduct = productdal.GetList("user_id=" + Request.QueryString["uid"] + " and product_name like %'" + Request.QueryString["search"] + "'%").Tables[0];
            }
            else if (!string.IsNullOrEmpty(Request.QueryString["uid"]) && string.IsNullOrEmpty(Request.QueryString["search"]))
            {
                dtproduct = productdal.GetList("user_id=" + Request.QueryString["uid"]).Tables[0];
            }
            switch (Request.Form["action"]) { 
                case "select":
                    Response.Write("<script Language=\"Javascript\">top.location=\"product_list.aspx?uid=" + Request.Form["uid"].Trim().ToString() + "&wxid=" + Request.Form["wxid"].Trim().ToString() + "&search=" + Request.Form["search_textBox"].Trim().ToString() + "\";");
                    Response.Write("</script>");
                    Response.End();
                    break;
            }
    
        }
    }
}